<template>
  <div>
    <!-- 面包屑导航 -->
    <breadcrumb-nav>
      <template v-slot:firstMenu>商品管理</template>
      <template v-slot:secondMenu>发布审核</template>
    </breadcrumb-nav>
    <!-- 卡片视图-->
    <el-card class="box-card">
      <AuditTypes @input="handleTypeChange"></AuditTypes>
      <!-- 展示的表格 -->
      <audit-table :query-info="queryInfo" :add-banner="total" @total="setTotal" :auditType="auditType"/>
      <Pagination :query-info="queryInfo" :total="total" @page-size-change="handleSizeChange"
                  @current-page-change="handlePageChange"/>
    </el-card>
  </div>
</template>

<script>
/**
 * @author 太阳当空丶赵
 * @date 2022/11/16-16:31
 * @version 1.0.0
 */
import BreadcrumbNav from "../common/BreadcrumbNav";
import AuditTable from './auditChildComponents/auditTable'
import AuditTypes from "./auditChildComponents/auditTypes"
import Pagination from '@/components/common/Pagination'
export default {
  name: "goodsAudit",
  components:{BreadcrumbNav,AuditTable,Pagination,AuditTypes},
  data() {
    return {
      auditType: -1,
      queryInfo: {
        pageNum: 1, // 当前页
        pageSize: 5 // 每页显示多少条数据
      },
      total: 0
    }
  },
  methods:{
    setTotal(total){
      this.total = Number(total)
    },
    handleSizeChange(size) {
      this.queryInfo.pageSize = size
    },
    handlePageChange(page) {
      this.queryInfo.pageNum = page
    },
    handleTypeChange(type){
      this.auditType = type
    }
  }
}
</script>

